Initialize binlog event scalar members - #732
Open
SeojunKim-pumisj wants to merge 1 commit into
Open
Conversation
|
Thank you for your pull request and welcome to our community! To contribute, please sign the Oracle Contributor Agreement (OCA).
To sign the OCA, please create an Oracle account and sign the OCA in Oracle's Contributor Agreement Application. When signing the OCA, please provide your GitHub username. After signing the OCA and getting an OCA approval from Oracle, this PR will be automatically updated. If you are an Oracle employee, please make sure that you are a member of the main Oracle GitHub organization, and your membership in this organization is public. |
SeojunKim-pumisj
force-pushed
the
fix-706-log-event-initialization
branch
from
August 25, 2026 07:36
598c159 to
9f0cd25
Compare
SeojunKim-pumisj
marked this pull request as ready for review
August 29, 2026 14:41
SeojunKim-pumisj
requested review from
gopshank and
seemasundara
as code owners
August 29, 2026 14:41
Initialize Log_event_header and Rows_event scalar fields in every constructor path. This prevents GCC 15 from diagnosing potentially uninitialized reads in Rows_log_event and also gives malformed-event early returns deterministic state.
SeojunKim-pumisj
force-pushed
the
fix-706-log-event-initialization
branch
from
September 7, 2026 12:51
9f0cd25 to
915eeb1
Compare
|
Thank you for signing the OCA. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this change do?
Initializes all scalar members of
Log_event_headerand the previously omitted scalar members ofRows_eventin their construction paths. This keeps malformed-event early returns in a deterministic state and addresses GCC 15 uninitialized-use diagnostics.Fixes #706.
Why is it needed?
Some parsing constructors can return early for malformed input before every scalar member has been assigned. Later cleanup or diagnostic paths may then observe indeterminate values, and GCC 15 reports potential uninitialized uses. Default initialization makes these objects safe and deterministic on every construction path.
How was it tested?
mysql-test/scripts/ci/mtr.shpasses locallyAdded gunit coverage under
unittest/gunit/binlogevents/for:Log_event_headerconstruction defaultsRows_eventstate after malformed input causes an early returnDocker validation using GCC 15.3.0 on Debian 13:
-Werror)event_initialization-t, includingbinlog_event.cppandrows_event.cppctest --test-dir /build -R '^event_initialization$' --output-on-failure: 1/1 passedsql/log_event.ccwith-O2 -Werror=uninitialized -Werror=maybe-uninitialized: passed with no diagnosticsAdditional checks:
clang-formatapplied using the repository stylegit diff --checkMTR was not added because this change does not alter SQL behavior; the constructor gunit and optimized GCC 15 compilation directly exercise the affected initialization and diagnostic paths. A full server build and MTR suite were not run locally.
Contributor checklist
scripts/ci/format.sh)AI assistance
AI assistance was provided by OpenAI Codex for issue analysis, patch and test generation, Docker-based GCC 15 validation, and diff review. The resulting diff and repository state were inspected, and the checks listed above were run; a full server build and MTR suite have not been completed locally.
Areas touched
Replication, binary logging, binlog event parsing, and binlog event gunit tests.